<template>
    <base-page class="base-form" title="我的评分" @back="onCancel()">
        <view style="overflow-y: auto; min-height: 500px;">
            <!-- 有数据时显示列表 -->
            <view v-if="CourseInfoSignList && CourseInfoSignList.length > 0">
                <view v-for="(item, index) in CourseInfoSignList" :key="index">
                    <view class="u-body-item"
                        style="display: flex;align-items: center;justify-content: space-between;margin:8px;background-color: white;padding: 8px;">
                        <view class="u-body-item-title u-line-2">{{ item.title }}</view>
                        <u-button type="primary" @click="toGowen(item)">去评分</u-button>
                    </view>
                </view>
            </view>

            <!-- 无数据时显示空状态 -->
            <view v-else class="empty-container">
                <view class="empty-image">
                    <image src="../../static/empty-image-default.png" mode="aspectFit"></image>
                </view>
                <view class="empty-text">暂无未评分的试卷</view>
            </view>
        </view>
    </base-page>
</template>
<script>
import {
    CourseInfoController
} from "@/api";
export default {
    data() {
        return {
            mySignInList: [],
            CourseInfoSignList: [],
            student: null
        }
    },
    onLoad(data) {
                                                                                                                                                                                              
    },
    methods: {
        onCancel() {
            uni.switchTab({
                url: '/pages/work/index'
            })
        },
        getMySign() {

        },
        toGowen(item) {
            uni.navigateTo({
                url: `/views/generated/gowen?historyId=${encodeURIComponent(JSON.stringify(item.historyId))}`
            })
        },
        getDate() {
            CourseInfoController.getNotScorePaper(this).then((res) => {
                //过滤一下res数组，只要 isteacherScore 为 1 的数据
                this.CourseInfoSignList = res.dataList.filter(item => item.isteacherScore == 1);
            })
        },
    },
    mounted() {
        this.getDate();
    }
}
</script>

<style scoped>
.exam-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.exam-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.exam-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.exam-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1a1a1a;
}

.exam-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 14px;
    color: #666;
}

.exam-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background-color: #fff3e0;
    color: #f57c00;
}

.status-completed {
    background-color: #e8f5e9;
    color: #4caf50;
}

/* 空状态样式 */
.empty-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-image {
    width: 180px;
    height: 180px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-image image {
    width: 100%;
    height: 100%;
}

.empty-text {
    font-size: 16px;
    color: #999999;
    margin-top: 10px;
}
</style>